import request from "@/utils/request";
import { ApiRes, CategoryItem, TopCategory, SubCategory } from "@/types/data";

// 获取头部分类导航
export function getCategory () {
  return request<ApiRes<CategoryItem[]>>({
    url: '/home/category/head',
    method: "get",
  });
}


// 获取面包屑导航
export function getTopCategory (params: { id: string }) {
  return request<ApiRes<TopCategory>>({
    url: '/category',
    method: "get",
    params
  });
}


// 获取二级面包屑导航
export function getSubCategory (params: { id: string }) {
  return request<ApiRes<SubCategory>>({
    url: '/category/sub/filter',
    method: "get",
    params
  });
}
